function Validator(){
    this.flag = 1;
    this.warning = "Warning message: \n\n";

    this.input = function(id, message)
    {
        var obj = document.getElementById(id);
        if ("" == trim(obj.value)) {
            this.flag = -1;
            this.warning += message + "\n";
            obj.focus();
            return false;
        } else {
            return true;
        }
    }

    this.select = function(id, message)
    {
        var obj = document.getElementById(id);
        if ("" == trim(obj.options[obj.selectedIndex].value)) {
             this.flag = -1;
            this.warning += message + "\n";
            obj.focus();
            return false;
        } else {
            return true;
        }
    }

    this.validateUrl = function(id, message)
    {
        var obj = document.getElementById(id);
        var url = obj.value;
        var regExp=new RegExp("((^http)|(^https)|(^ftp))://(\w)+.(\w)+");
        var rtn=url.match(regExp);
        if (rtn==null)
        {
            this.flag = -1;
            this.warning += message + "\n";
            return false;
        }
        else
        {
            return true;
        }
    }
    
}